UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3ryiWK1Fb860oNjhPCpVRq8zbI6asgwwYRrKVP3RCCQ=' 
WHERE 
  key_id = '616629398662cb585f4b2cf9687dc12458752eee3d089a19110d9890422a9f5c' 
  AND (
    token = '3ryiWK1Fb860oNjhPCpVRq8zbI6asgwwYRrKVP3RCCQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019