UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rDWwRYK1ubZvPG/YfCzetLc1Aw/QahrM31dh7MSbWh0='
WHERE
key_id = '2aa1d840822e1d302614c8ed3ea02bfc6008e573028b6d0175bdf8222a979a71'
AND (
token = 'rDWwRYK1ubZvPG/YfCzetLc1Aw/QahrM31dh7MSbWh0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)