UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sdkifaFTOnIecgHPfE/WZEzB/8B5wov4ReX6X9l3fUs='
WHERE
key_id = '72b141f779fa085b6f4c614403566a059b819c9e2c8cda7f97deb7db31b33bbe'
AND (
token = 'sdkifaFTOnIecgHPfE/WZEzB/8B5wov4ReX6X9l3fUs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)