UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wPbXjIlFh1eS5iGPMtvaTQ/pzxEiVodUBuTAmkB6/AI=' 
WHERE 
  key_id = '929025a69973d4ae17831cec9ab0847b2ba6a08c2d7f3cc0cb835a58d73a0d6e' 
  AND (
    token = 'wPbXjIlFh1eS5iGPMtvaTQ/pzxEiVodUBuTAmkB6/AI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030