UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FqHAZfhMhz9c3MwQ0KRhzdxx3a45o8+R7O0ng3tYujE=' 
WHERE 
  key_id = 'efcd0ad1d4fa908646b1e59001709ae3b096c60d09b58373809ead7c5a6a8148' 
  AND (
    token = 'FqHAZfhMhz9c3MwQ0KRhzdxx3a45o8+R7O0ng3tYujE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019