UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oeV1e05Yx0YWzRLHeCFMWEZijumHg2MRHIyq5aMOEcU=' 
WHERE 
  key_id = 'f2b5ddb76451522017019ea7f750ee2656fa5503900435ab0b19cd8eaa4eff8d' 
  AND (
    token = 'oeV1e05Yx0YWzRLHeCFMWEZijumHg2MRHIyq5aMOEcU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021