UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zul8kV0ALenvXHYNepSZaRY1yRpZ17KgoeGnW9HyqQo='
WHERE
key_id = '2c36e76ea53a0dc8f092446f30a81bf35d79e20f96a6b921d66762e08733908b'
AND (
token = 'Zul8kV0ALenvXHYNepSZaRY1yRpZ17KgoeGnW9HyqQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)