UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ux6e6l6c/UqvlcHghK1guV4WIEzC0h4Y9gzzF0pUUq8=' 
WHERE 
  key_id = '006f496dd4a249a08317ed9a586c2f081bfc7555cb8b920061f999587d1adcfd' 
  AND (
    token = 'Ux6e6l6c/UqvlcHghK1guV4WIEzC0h4Y9gzzF0pUUq8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030