UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '03ZdgRUArLpPrxYikMPYqvVqxpRmnPSYaxmv3Dj90mI='
WHERE
key_id = 'f32d662f07bc818f16fdb2cf03bc4f11b40f67c4186789ec96a300e248795e2c'
AND (
token = '03ZdgRUArLpPrxYikMPYqvVqxpRmnPSYaxmv3Dj90mI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)