UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5XHGqCNhFXPpcSk8+Q6ikO2aIoR8mbkOpi9P9hmhQEM=' 
WHERE 
  key_id = 'f0ea703946bca61c395a60f0913847a49c8aa99494e1890bd81e987a22b62713' 
  AND (
    token = '5XHGqCNhFXPpcSk8+Q6ikO2aIoR8mbkOpi9P9hmhQEM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024