UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QU+LtFlJt9Sggz/AESVKlBgb1ygu0z2w596TDfRtjeM=' 
WHERE 
  key_id = '01ed6d0883563c3827048e9f5c639ebca0296cc77bb84d0926fc606ab50048ff' 
  AND (
    token = 'QU+LtFlJt9Sggz/AESVKlBgb1ygu0z2w596TDfRtjeM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036