UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x+KaOmKAdxOgLAWRZYySwZ6KDXqgVeQByWTrt6jokyo=' 
WHERE 
  key_id = '0f94ad769cda1a66e424d8e8570a4f9658af4a0fbfc732d5b51624aacba91e69' 
  AND (
    token = 'x+KaOmKAdxOgLAWRZYySwZ6KDXqgVeQByWTrt6jokyo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040