UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zw9jSFjWpeoFbsMcwFbpOx7h9YNb5HrAJ0BqvOA8lBw=' 
WHERE 
  key_id = '7b5d5d5fd54244096428d7ad41020fa5eb5e3fb6569d4d8bf5e521fde1f821a4' 
  AND (
    token = 'Zw9jSFjWpeoFbsMcwFbpOx7h9YNb5HrAJ0BqvOA8lBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032