UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xUTzSPMXQtlZ/kMlq5bUPJKFXxRVIodQJbnYZsS7vs4=' 
WHERE 
  key_id = '86604f50a37fd3861a4d415c1fddb7f9abaa95af6b938a62b93e7982bb763214' 
  AND (
    token = 'xUTzSPMXQtlZ/kMlq5bUPJKFXxRVIodQJbnYZsS7vs4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028