UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v7Zc5N9cUPVTqBbOBDtr0rLXr14Jm54FvFS/jiKbZ8c='
WHERE
key_id = '70c6001e4ec0cb3621eb74fa59cef5a94b069b314d5ef12adcc45a25fa1007ee'
AND (
token = 'v7Zc5N9cUPVTqBbOBDtr0rLXr14Jm54FvFS/jiKbZ8c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)