UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MkvFgatmq3O3tImW2ZYU85NsQJh4f09F5eA9VAqdfZU='
WHERE
key_id = 'fe7218c70079fc933df061354e3d9abdf189ac17796d7ae0deb7676d570e630c'
AND (
token = 'MkvFgatmq3O3tImW2ZYU85NsQJh4f09F5eA9VAqdfZU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)