UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '98Z0+R2hTBmrBXWjrHleLBhJLmPFomCm9rl8RFpPPxc=' 
WHERE 
  key_id = '061a193d75ceea82d3a728f7bd69103a0e738ad6a400bb6698c4cd2b8d994c5b' 
  AND (
    token = '98Z0+R2hTBmrBXWjrHleLBhJLmPFomCm9rl8RFpPPxc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017