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

Query time 0.00028