UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '48ASu32nct3n1AVhB5PJEvCU3IqXPEGzXL7ZV6JToUA=' 
WHERE 
  key_id = '711106caa28c7d9e05716117082b60e0e0d99e1c5a2b54d410fd4cadcd231e39' 
  AND (
    token = '48ASu32nct3n1AVhB5PJEvCU3IqXPEGzXL7ZV6JToUA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025