UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S+Cb+SPCv835RByrCu+6UV3fNtguywclWxrIob1dh14='
WHERE
key_id = '15cf6aee1124394cc04323d65ee78f60a9fb48a4a4b9dcb24b8554dd4e63a7df'
AND (
token = 'S+Cb+SPCv835RByrCu+6UV3fNtguywclWxrIob1dh14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)