UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3iYGYMiMzwDf/Gbc5NxFGdpvJ2/eynd7jJf/DTXVZGw=' 
WHERE 
  key_id = '5266aa52d423dcc3ba9027ddc937f718c043e98f848aaa87b6c6e39f5cf0f97d' 
  AND (
    token = '3iYGYMiMzwDf/Gbc5NxFGdpvJ2/eynd7jJf/DTXVZGw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030