UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9kUqmn7lgaVZMzD6qhxQebRU6wXqNu6iw+BW3Yumk2Y='
WHERE
key_id = '3f44e60fba4a0d0c7f87bc2901ffa695655e32649dc66f84a99066b604c7fa46'
AND (
token = '9kUqmn7lgaVZMzD6qhxQebRU6wXqNu6iw+BW3Yumk2Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)