UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'smE5j2jEBVvX5s8qyPuOUJtLieK5AOr4ATzpkPqP9N4='
WHERE
key_id = '1c46f94cae7bf01cbbb73897eb2698fe99f29fcc229a3eb4fc5519db74326f4d'
AND (
token = 'smE5j2jEBVvX5s8qyPuOUJtLieK5AOr4ATzpkPqP9N4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)