UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '81TZlDwxmyd4VVXwwhNuEtcbIpezTIQDYBKSHxZ5GQQ=' 
WHERE 
  key_id = '13c0e0032a19e94081ffaa26d861a8f52d54a38e6bfa6ad827d5e2e73b2c3982' 
  AND (
    token = '81TZlDwxmyd4VVXwwhNuEtcbIpezTIQDYBKSHxZ5GQQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052