UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o0tfMpW2G3YXa9LXFcPIXCWEU0d0Jk0ZP6TS9/u52Ww='
WHERE
key_id = '2b958e6272060a8974bd0f32a7298691056a8680a5b79682bf6e16ce82f937ad'
AND (
token = 'o0tfMpW2G3YXa9LXFcPIXCWEU0d0Jk0ZP6TS9/u52Ww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)