UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KFRTPZGXkGURD8ET3H3kZMO2BX+LNpPIZVynFAdRTIg='
WHERE
key_id = '4b11205dd6086e1e2ec3a7038f0f25a8c4df7b3782fb344db392d10fea9c9ca8'
AND (
token = 'KFRTPZGXkGURD8ET3H3kZMO2BX+LNpPIZVynFAdRTIg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)