UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hwCSm4Wgk7w1WodFAbAkVuIuxt+pDlOtiCXKwJf/d5A='
WHERE
key_id = '3a19e95f220f4bb457de6a4dff8deaa5511251aae0b72d5f1acbc024c5cdc9e7'
AND (
token = 'hwCSm4Wgk7w1WodFAbAkVuIuxt+pDlOtiCXKwJf/d5A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)