UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hryEzerLmkNBNrQY2cisiBgn/S6SGYqtR0ow6psbdD0=' 
WHERE 
  key_id = 'de0776caa9c5778371eac7853108da882cf1bc4074694d44c51b2e23a8650466' 
  AND (
    token = 'hryEzerLmkNBNrQY2cisiBgn/S6SGYqtR0ow6psbdD0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022