UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WVgmDX4l1mn+hFO/ojbJDZKfgD8jb3naylz3I9htZNA='
WHERE
key_id = '79b80b0ba2b92d0cb1ca0bfbba16f0412b376ccb6cc01c34703e4cd2d5ad9813'
AND (
token = 'WVgmDX4l1mn+hFO/ojbJDZKfgD8jb3naylz3I9htZNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)