UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kSQb08hkbXzoSNtvkEBvAYcF2nd+CA0A7UhFO+R7Jbo=' 
WHERE 
  key_id = 'c06c05311d881adf054547b6212f7ceca141eeda9b056e31935b1d90b070351f' 
  AND (
    token = 'kSQb08hkbXzoSNtvkEBvAYcF2nd+CA0A7UhFO+R7Jbo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023