UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YBSr2JAOZpME1xKM03nBHD0Irl9GtORy9R/95YL/lPI=' 
WHERE 
  key_id = '13a7d5c9279e3e400be1cdc6a87431c42cb9a01127af6a7effb83a41351ad7b8' 
  AND (
    token = 'YBSr2JAOZpME1xKM03nBHD0Irl9GtORy9R/95YL/lPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020