UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wrKD9uE/36wr3QblNS29+AFO/Skqda4R21ppp41g9VM='
WHERE
key_id = '4fb52bf4da75f3056f3a2ac376a99e07ef653754d3c7513a4573328e6aaa3de0'
AND (
token = 'wrKD9uE/36wr3QblNS29+AFO/Skqda4R21ppp41g9VM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)