UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cy8l7OEhWj8R5MnaUvbPq+WVgxU8PQJ3QP8rrroU6Vs=' 
WHERE 
  key_id = '89e72d7bf31ab97f0b26ae77b4739c88b2b43501f72f586042c6ccad37b1c65a' 
  AND (
    token = 'Cy8l7OEhWj8R5MnaUvbPq+WVgxU8PQJ3QP8rrroU6Vs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027