UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bLTFuLxZPZ/b7zspktjOYLmEyvvjZEtYBCy1Ku/fUe0=' 
WHERE 
  key_id = 'aba39155cae0f2d4cd2738dbedf542bd0c762f16109b3e5e72bbeba6df6e86e3' 
  AND (
    token = 'bLTFuLxZPZ/b7zspktjOYLmEyvvjZEtYBCy1Ku/fUe0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033