UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g+7Y6WjL1mQRb5llIjRyN1krG73Ua40466AtmKEjjZM=' 
WHERE 
  key_id = '7015db71287b7a8272a682b4d4b89d86dac6ca540a98bfff4490e403558ebfba' 
  AND (
    token = 'g+7Y6WjL1mQRb5llIjRyN1krG73Ua40466AtmKEjjZM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030