UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MuLxeHc0Bwn6sWGfZLiU40oy1jyXP89BQHujhZqRHnA='
WHERE
key_id = 'b41be61a4f61f4fd4fcee8c9565e39a921d20f98cb212a5239196cfdb1682bf9'
AND (
token = 'MuLxeHc0Bwn6sWGfZLiU40oy1jyXP89BQHujhZqRHnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)