UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bvtrF58AiJEc3tke++rriNkUVoHyy64J6Iwb7nBplSQ=' 
WHERE 
  key_id = '911328ebbb3ec8004adff7a99221fef57dd10a89081f5bd7210adb2531aca01e' 
  AND (
    token = 'bvtrF58AiJEc3tke++rriNkUVoHyy64J6Iwb7nBplSQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038