UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wMvafCIYPBAf6gU0UhIPX7CKafb56o/vzlYkp2MENDc='
WHERE
key_id = '49bd0b6c0b560ef27f4091607779a6c2e07d313d9dae51ef95b2e5ec9a1f24f7'
AND (
token = 'wMvafCIYPBAf6gU0UhIPX7CKafb56o/vzlYkp2MENDc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)