UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v0ZotvaFE8Fnh17HTpEBsduZoPEcXYTdgFpIao+Tw+o=' 
WHERE 
  key_id = 'bc50f9ba29f6eaf8ea4976540f3ace3dc197978e2cc7f7df6ae8bfe0094d20e9' 
  AND (
    token = 'v0ZotvaFE8Fnh17HTpEBsduZoPEcXYTdgFpIao+Tw+o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034