UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cFJy5QkcgEWmGvjqSn7xsaEiwR+9jEfB7JPIS6SpYuk=' 
WHERE 
  key_id = 'd0067fc89460cdf589a4b9e333ed6eaabb1c01518919dd58f71db1b434e5dbb2' 
  AND (
    token = 'cFJy5QkcgEWmGvjqSn7xsaEiwR+9jEfB7JPIS6SpYuk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061