UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XGtQuLzxh+BQIWc4/ymgrgkl8kqhWigYF1Xa6koaRLE=' 
WHERE 
  key_id = 'ca66fde6f250bb789a7e4f5f7e310b3ff34932fa33a51ed9e76b709b24e0bbc9' 
  AND (
    token = 'XGtQuLzxh+BQIWc4/ymgrgkl8kqhWigYF1Xa6koaRLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022