UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0bxZtOOIzOenfoeOX6gU+yzMFCfTOzbNeBw+wpEqvR8='
WHERE
key_id = '6c321605bafb9e56e9dbec2d2bd8801f4dd930a55cbc1bf13e5cecd4213acc5f'
AND (
token = '0bxZtOOIzOenfoeOX6gU+yzMFCfTOzbNeBw+wpEqvR8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)