UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TYsvAIX8fr/HhdohcT7rNCHOZ/u9dxjZ30WHeTrsXE8='
WHERE
key_id = '199bdd70362ac26f45ec8f3a6f15b68f2217ad213631ec8a1e935997c2373e70'
AND (
token = 'TYsvAIX8fr/HhdohcT7rNCHOZ/u9dxjZ30WHeTrsXE8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)