UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cbw9z/XA3BEgFISHSXiMBrEdPsVe6p9pGsdtf7zKHzs='
WHERE
key_id = '18fe9e39b821cdc8e3a785bac09d77b41b7f82e5a933b87587db0976a6924240'
AND (
token = 'Cbw9z/XA3BEgFISHSXiMBrEdPsVe6p9pGsdtf7zKHzs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)