UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VIQgK6droGTXP8dXaQNem1eeukGqsb/yI71EFIGxePc='
WHERE
key_id = 'd59167d69551b69a1d1e58ed66e20f5fb9905bf9277d9a53dac947eb16ec53c8'
AND (
token = 'VIQgK6droGTXP8dXaQNem1eeukGqsb/yI71EFIGxePc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)