UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YXheZx/TEs/FruBp27NntHuNqtQTCbdTvI1+zLLQQaE='
WHERE
key_id = 'ba1d25419fa2b464055e6a7d91811d8ee0bd8839b7292627ec14cda1204a99a3'
AND (
token = 'YXheZx/TEs/FruBp27NntHuNqtQTCbdTvI1+zLLQQaE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)