UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tfw1RSGjsMQvGbD3i2L726yWiTqYIEfB9eGu+VP25AM='
WHERE
key_id = '336fde103d1bc0834f2be860f22d98e7556e0975c356a9efbe5fa6c6983f9ec8'
AND (
token = 'Tfw1RSGjsMQvGbD3i2L726yWiTqYIEfB9eGu+VP25AM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)