UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hz45/8U66uTLTtpLo10CzFm+emv2ljKIZKTGzZtCOus=' 
WHERE 
  key_id = '191ea19057371f71579e51a3780f97c7335d6819d34f98fe748ca5396d8ed4ce' 
  AND (
    token = 'Hz45/8U66uTLTtpLo10CzFm+emv2ljKIZKTGzZtCOus=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022