UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UaG/nX0rZWp85KlpPMsWNPojkQ8iOa3qh7WdSrcYcqw='
WHERE
key_id = 'e4c10b2d0c8df3e4cd0181077c19ba6dbd70e5a16ebce06dc71f38490047199e'
AND (
token = 'UaG/nX0rZWp85KlpPMsWNPojkQ8iOa3qh7WdSrcYcqw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)