UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jYy0bROCQrdsKL1d2xZRIU7tKDzvR6tPy3q+w+/wvN0='
WHERE
key_id = '5072b1df598027549cfe4958bc284eab45e6ef865026ed54163ea13cdefc19cb'
AND (
token = 'jYy0bROCQrdsKL1d2xZRIU7tKDzvR6tPy3q+w+/wvN0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)