UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v4dkKXqGrwV/iVE+0edTUS8brUfTRRkA2+gxQRfsseg='
WHERE
key_id = '37886022494b4818fe26702015faafb7d12f8190ab606dfe555e4809a64401d9'
AND (
token = 'v4dkKXqGrwV/iVE+0edTUS8brUfTRRkA2+gxQRfsseg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)