UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+J5isWpxXrL3PS0rEzOYF0+dWR5ErdsLSqFF1IawH6E=' 
WHERE 
  key_id = '8c9d5a275703dce913542527ad2f8b070acbbe89d7832a499a985f280afb7d26' 
  AND (
    token = '+J5isWpxXrL3PS0rEzOYF0+dWR5ErdsLSqFF1IawH6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017