UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dn+fiXxMcNmpPmZob27LuE/CdU3QZFLSLL99B6iIihU='
WHERE
key_id = '17e02f85d08e8f807a3c20c04d898923bf69420ce98ef405b0f918e1247aae2c'
AND (
token = 'Dn+fiXxMcNmpPmZob27LuE/CdU3QZFLSLL99B6iIihU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)