UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9MLkprsdfeR0oIep1SyyBlp12il+Qfk6/xwY5Ot75QU='
WHERE
key_id = '5b979dae5e02d69e7b522e2421369144e64b6fe3d9a7e3f2f389aa9ed7f6c197'
AND (
token = '9MLkprsdfeR0oIep1SyyBlp12il+Qfk6/xwY5Ot75QU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)