UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9iWErPWhk43IWoxQ0++scwgi7diS/Z8mO1+NZSm8AVo='
WHERE
key_id = '353c339daf299c32da462e191ca32f41e8233e9100e9562518dc9d9e9042af2a'
AND (
token = '9iWErPWhk43IWoxQ0++scwgi7diS/Z8mO1+NZSm8AVo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)